from tortoise import fields

from .base import BaseModel, TimestampMixin


class Poetry(BaseModel, TimestampMixin):
    title = fields.CharField(max_length=200, description="名称", index=True)
    categoryCode = fields.CharField(max_length=200, description="类别编码")
    rhythmic = fields.CharField(max_length=200, null=True, default="", description="词牌名")
    author = fields.CharField(max_length=200, null=True, default="", description="作者")
    chapter = fields.CharField(max_length=500, null=True, description="章节")
    section = fields.CharField(max_length=500, null=True, description="章节")
    desc = fields.CharField(max_length=500, null=True, description="简介")
    paragraphs = fields.JSONField(null=True, description="段落")
    notes = fields.JSONField(null=True, description="注释")


class Meta:
    table = "poetry"
